package com.kgc.storeprovider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InventoryCheck;
import com.kgc.store.remote.InventoryCheckRemote;
import com.kgc.storeprovider.service.InStoreService;
import com.kgc.storeprovider.service.InventoryCheckService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class InventoryCheckController implements InventoryCheckRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InventoryCheckService inventoryCheckService;

    @Override
    public ResponseMsg getInventoryCheckList(Map<String, Object> map) {
        logger.info("InventoryCheckController getInventoryCheckList map:"+map);
        ResponseMsg msg = inventoryCheckService.getInventoryCheckList(map);
        logger.debug("InventoryCheckController getInventoryCheckList msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg delInventoryCheck(String code) {
        logger.info("InventoryCheckController delInventoryCheck code:"+code);
        ResponseMsg msg = inventoryCheckService.delInventoryCheck(code);
        logger.debug("InventoryCheckController delInventoryCheck msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg insertInventoryCheck(InventoryCheck inventoryCheck) {
        logger.info("InventoryCheckController insertInventoryCheck inventoryCheck:"+inventoryCheck);
        ResponseMsg msg = inventoryCheckService.insertInventoryCheck(inventoryCheck);
        logger.debug("InventoryCheckController insertInventoryCheck msg:"+msg);
        return msg;
    }
}
